import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '@/views/Home'
Vue.use(VueRouter)
// 路由配置
const routes = [
  {
    path: '/home',
    name: 'Home',
    alias:"/",/* 重定向 */
    component: () => import('../views/Home.vue')
  },
  // 其他页面是需要用户手动点击才会显示的，所以为了优化性能，使用路由懒加载
  {
    path: '/search',
    name: 'Search',
    component: () => import('../views/Search.vue')
  },
  {
    path: '/shop',
    name: 'Shop',
    component: () => import('../views/Shop.vue')
  },
  {
    path: '/my',
    name: 'My',
    component: () => import('../views/My.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
